-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance Modal Deployment Infrastructure with Improved Robustness #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideRefactors the deployment tool by extending the main Deployer.sh with ANSI colorization, version and environment validation, deployment verification and interactive post-deploy options; adds comprehensive documentation and templates; and updates individual example scripts and apps to Modal 1.0.0—including refactoring the Linear webhooks service into a FastAPI ASGI app with Pydantic models, HMAC signature checks, file-based logging, persistent volumes, and improved Slack chatbot support. Sequence Diagram for Linear Webhook Processing in ModalsequenceDiagram
participant Linear as Linear Service
participant ModalEndpoint as Modal Endpoint (/webhook)
participant FastAPIApp as FastAPI App (linear-webhooks)
participant Logger as log_event()
participant EventHandler as Event Handler (issue/comment)
participant Volume as Persistent Volume (linear-data)
Linear->>ModalEndpoint: POST /webhook (event data, signature)
ModalEndpoint->>FastAPIApp: Forward request
activate FastAPIApp
FastAPIApp->>FastAPIApp: Verify signature (HMAC SHA256)
FastAPIApp->>FastAPIApp: Parse request to LinearEvent model
FastAPIApp->>Logger: log_event(LinearEvent)
activate Logger
Logger->>Volume: Write event to JSONL file (/data/linear_events_...)
deactivate Logger
alt Event type is "Issue"
FastAPIApp->>EventHandler: handle_issue_event(LinearEvent)
else Event type is "Comment"
FastAPIApp->>EventHandler: handle_comment_event(LinearEvent)
else Other event type
FastAPIApp->>FastAPIApp: Prepare "ignored" response
end
activate EventHandler
EventHandler-->>FastAPIApp: Processed event response
deactivate EventHandler
FastAPIApp-->>ModalEndpoint: HTTP Response
ModalEndpoint-->>Linear: HTTP Response
deactivate FastAPIApp
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
I see a check failed - I'm on it! 🫡 |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
|
I've fixed the failing pre-commit checks in PR #141. The issue was related to formatting in some of the Modal deployment infrastructure files. I've committed and pushed the fixes to the same branch. The changes include:
The PR should now pass the checks and be ready for review. 💻 View my work • React 👍 or 👎 |
User description
Overview
This PR enhances the Modal deployment infrastructure in the codegen-examples repository with improved robustness, better error handling, and updates to the latest Modal version (1.0.0).
Key Improvements
Main Deployer.sh Script
Documentation
Individual deploy.sh Scripts
Template and Examples
Testing
The deployment infrastructure has been tested with the following examples:
All examples deploy successfully and run as expected with the latest Modal version.
Next Steps
Future improvements could include:
💻 View my work • About Codegen
Summary by Sourcery
Enhance and standardize the Modal-based deployment infrastructure across codegen-examples by updating to Modal 1.0.0, refactoring webhook handlers into ASGI FastAPI services, enriching deploy scripts with colorized output, version checks, environment validation, deployment verification, and post-deployment options, and by adding user-friendly documentation.
New Features:
Enhancements:
Documentation:
PR Type
Enhancement, Documentation
Description
Major refactor of Modal deployment scripts for robustness and UX
Upgrade Modal-based examples to Modal 1.0.0 and FastAPI ASGI services
linear_webhooksto FastAPI ASGI app with signature verificationslack_chatbotdeployment and API for new Modal versionAdd comprehensive documentation and deployment templates
README.mdfor examples and deployment guidedeploy.sh.templatefor new Modal examplesImprove user feedback and error messages across all scripts
Changes walkthrough 📝
6 files
Robust, interactive deployer with color, checks, and post-deployoptionsImproved deployment script with validation and feedbackEnhanced deployment script with env checks and feedbackRefactor to FastAPI ASGI app, add signature verification, Modal 1.0.0Update Modal app name, add persistent volume, deploy entrypointStandardize env template formatting and variable names2 files
Add comprehensive documentation for examples and deploymentAdd template for new Modal deploy scripts with best practices